package com.dmj.sqldsl.builder;

import com.dmj.sqldsl.builder.config.EntityConfig;
import com.dmj.sqldsl.builder.config.GlobalConfig;
import com.dmj.sqldsl.model.DslInsert;

public class InsertFinishBuilder<T, R> {

  private final InsertConflictBuilder<T, R> insertConflictBuilder;

  public InsertFinishBuilder(InsertConflictBuilder<T, R> trInsertConflictBuilder) {
    this.insertConflictBuilder = trInsertConflictBuilder;
  }

  private DslInsert toInsert(EntityConfig config) {
    return insertConflictBuilder.toInsert(config);
  }

  public DslInsert toInsert() {
    return this.toInsert(GlobalConfig.getEntityConfig());
  }
}
